当前位置: 首页>>代码示例>>C++>>正文


C++ QCheckBox::setCursor方法代码示例

本文整理汇总了C++中QCheckBox::setCursor方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setCursor方法的具体用法?C++ QCheckBox::setCursor怎么用?C++ QCheckBox::setCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QCheckBox的用法示例。


在下文中一共展示了QCheckBox::setCursor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createIconButton

QAbstractButton* MainWindow::createIconButton(const QString &iconPath, const QString &text, QWidget *parent) const
{
    QCheckBox *button = new QCheckBox(text, parent);

    //button->setIcon(QIcon(iconPath));
    button->setStyleSheet("QCheckBox::indicator { image: url(" + iconPath.arg("") + "); }"
                          "QCheckBox::indicator:hover { image: url(" + iconPath.arg("_hovered") + "); }"
                          "QCheckBox::indicator:pressed { image: url(" + iconPath.arg("_pressed") + "); }");
    button->setIconSize(QImage(iconPath).size());
    button->setContentsMargins(0, 0, 0, 0);
    button->setCursor(Qt::PointingHandCursor);
    button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    return button;
}
开发者ID:AzanovAA,项目名称:MediaRenamer,代码行数:15,代码来源:mainwindow.cpp

示例2: initRenameFrame

QFrame* MainWindow::initRenameFrame(QWidget *parent)
{
    QFrame *frame = new QFrame(parent);

    QAbstractButton *copyDownButton = createIconButton(QString(":/resources/copy_down_button%1.png"), "Copy Down", frame);
    QCheckBox *autoRenameBox = new QCheckBox("Auto Rename", frame);

    QHBoxLayout *layout = new QHBoxLayout(frame);

    frame->setFixedHeight(36);
    frame->setStyleSheet("QFrame {"
                             "background: qlineargradient(x1:0.5, y1:0, x2:0.5, y2:0.6, x3:0.5, y3:1,"
                                                          "stop:0 rgb(245, 245, 245),"
                                                          "stop:0.6 rgb(236, 236, 236),"
                                                          "stop:1 rgb(220, 220, 220));"
                             "border-bottom: 1px solid rgb(185, 185, 185);"
                         "}"
                         "QCheckBox::indicator:unchecked { image: url(:/resources/check_box_unchecked.png); }"
                         "QCheckBox::indicator:unchecked:pressed { image: url(:/resources/check_box_unchecked_pressed.png); }"
                         "QCheckBox::indicator:checked { image: url(:/resources/check_box_checked.png); }"
                         "QCheckBox::indicator:checked:pressed { image: url(:/resources/check_box_checked_pressed.png); }"
                         "QAbstractButton {"
                             "background: transparent;"
                             "font: bold 11px \"Arial\";"
                             "color: rgb(58, 58, 58);"
                         "}");

    autoRenameBox->setCursor(Qt::PointingHandCursor);

    layout->setContentsMargins(0, 2, 0, 2);
    layout->setSpacing(20);
    layout->setAlignment(Qt::AlignCenter);
    layout->addWidget(copyDownButton);
    layout->addWidget(autoRenameBox);

    connect(copyDownButton, SIGNAL(clicked()), filesListWidget, SLOT(copyDown()));
    connect(autoRenameBox, SIGNAL(toggled(bool)), filesList, SLOT(setAutoRename(bool)));

    return frame;
}
开发者ID:AzanovAA,项目名称:MediaRenamer,代码行数:40,代码来源:mainwindow.cpp

示例3: QWidget

AdminSailingTimesItem::AdminSailingTimesItem(QString id, QString cat, SaverDbSailingTimes data, QStringList islands, QWidget *parent) : QWidget(parent) {

	allData = data;
	this->islands = islands;
	this->id = id;
	category = cat;

	fromIsland = (data.from == cat);
	toIsland = (data.to == cat);

	// THIS IS THE LAYOUT STRUCTURE:
	/****************************************************************************************
	 *		islands				time	*			*	*
	 ********************************************************	dates		*  del	*
	 *			days				*			*	*
	 ****************************************************************************************/



	// The first row containing the islands and the time


	QLabel *labelSailingFrom = new QLabel("Sailing from");
	labelSailingFrom->setStyleSheet("font-weight: bold");


	QLabel *islandFixed = new QLabel(cat);
	islandFixed->setStyleSheet("font-weight: bold");

	QLabel *labelSailingTo = new QLabel("to");
	labelSailingTo->setStyleSheet("font-weight: bold");

	islandVariable = new QComboBox;
	islandVariable->setStyleSheet("font-weight: bold");
	islandVariable->addItem("Mainland");
	for(int j = 0; j < islands.length(); ++j) {
		islandVariable->addItem(islands.at(j));
		if(islands.at(j) == data.to && !fromIsland) islandVariable->setCurrentIndex(j+1);
	}
	if((fromIsland && !toIsland) || (!fromIsland && toIsland)) islandVariable->setCurrentIndex(0);



	QLabel *timeLabel = new QLabel("at");
	timeLabel->setStyleSheet("font-weight: bold");
	time = new Clock;
	time->setStyleSheet("font-weight: bold");
	time->setTime(QTime(data.sailingtime/100,data.sailingtime%100));


	QHBoxLayout *islandTimesLay = new QHBoxLayout;
	islandTimesLay->addWidget(labelSailingFrom);
	if(fromIsland) islandTimesLay->addWidget(islandFixed);
	else islandTimesLay->addWidget(islandVariable);
	islandTimesLay->addWidget(labelSailingTo);
	if(fromIsland) islandTimesLay->addWidget(islandVariable);
	else islandTimesLay->addWidget(islandFixed);
	islandTimesLay->addWidget(timeLabel);
	islandTimesLay->addWidget(time);
	islandTimesLay->addSpacing(10);
	islandTimesLay->addStretch();



	// The part containing checkboxes for all the days


	QHBoxLayout *dayLay = new QHBoxLayout;

	QStringList days;
	days << "Mo" << "Tue" << "Wed" << "Thu" << "Fri" << "Sat" << "Sun";
	for(int j = 0; j < days.length(); ++j) {
		QCheckBox *ch = new QCheckBox(days.at(j));
		ch->setCursor(Qt::PointingHandCursor);
		allDays.append(ch);
		if(data.daysofweek.at(j) == *"1") ch->setChecked(true);
		dayLay->addWidget(ch);
	}

	QVBoxLayout *islandsTimesDaysLay = new QVBoxLayout;
	islandsTimesDaysLay->addLayout(islandTimesLay);
	islandsTimesDaysLay->addLayout(dayLay);


	// the two rows of dates (start and end)

	QLabel *dateStartLabel = new QLabel("Starting:");
	dateStart = new DateEdit(150,"dd MMMM yyyy");
	dateStart->setDate(data.start);
	dateStart->setNoDateLimits();
	QHBoxLayout *dateStartLay = new QHBoxLayout;
	dateStartLay->addWidget(dateStartLabel);
	dateStartLay->addWidget(dateStart);

	QLabel *dateEndLabel = new QLabel("Ending:");
	dateEnd = new DateEdit(150,"dd MMMM yyyy");
	dateEnd->setDate(data.end);
	dateEnd->setNoDateLimits();
	QHBoxLayout *dateEndLay = new QHBoxLayout;
	dateEndLay->addWidget(dateEndLabel);
//.........这里部分代码省略.........
开发者ID:ferries,项目名称:booker,代码行数:101,代码来源:adminsailingtimesitem.cpp


注:本文中的QCheckBox::setCursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。