Пример #1
0
void TabBarWidget::tabInserted(int index)
{
	setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);

	QTabBar::tabInserted(index);

	if (m_showUrlIcon)
	{
		QLabel *label = new QLabel();
		label->setFixedSize(QSize(16, 16));

		setTabButton(index, m_iconButtonPosition, label);
	}
	else
	{
		setTabButton(index, m_iconButtonPosition, NULL);
	}

	if (m_showCloseButton || getTabProperty(index, QLatin1String("isPinned"), false).toBool())
	{
		QLabel *label = new QLabel();
		label->setFixedSize(QSize(16, 16));
		label->installEventFilter(this);

		setTabButton(index, m_closeButtonPosition, label);
	}

	updateTabs();

	emit tabsAmountChanged(count());
}
Пример #2
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    int x=QApplication::desktop()->width(),y=QApplication::desktop()->height();
    MainWindow w(x,y);
    Off off(x,y);
    off.setAttribute(Qt::WA_TranslucentBackground);
    off.setWindowFlags(Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint|Qt::Tool);//最前端和透明
    w.setFixedSize(x,y);
    w.setAttribute(Qt::WA_TranslucentBackground);
    w.setWindowFlags(Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint|Qt::Tool);//最前端和透明
    QImage image(":/image/3.png");
    QPixmap pixmap=QPixmap::fromImage(image.scaled(1477/2,1085/2));
    QLabel label;
    label.setFixedSize(1477/2,1085/2);
    label.setPixmap(pixmap);
    label.setAttribute(Qt::WA_TranslucentBackground);
    label.setWindowFlags(Qt::FramelessWindowHint|Qt::Tool|Qt::WindowStaysOnBottomHint);
    taskbar(label,x,y);
    label.show();
    off.show();
    w.show();
    QObject::connect(&off,SIGNAL(suspend_movie()),&w,SLOT(suspend()));
    QObject::connect(&off,SIGNAL(quit()),&a,SLOT(quit()));
    return a.exec();
}
Пример #3
0
QWidget *Summary::createHeader(QWidget *parent, const QPixmap &icon, const QString &heading)
{
    QHBox *hbox = new QHBox(parent);
    hbox->setMargin(2);

    QFont boldFont;
    boldFont.setBold(true);
    boldFont.setPointSize(boldFont.pointSize() + 2);

    QLabel *label = new QLabel(hbox);
    label->setPixmap(icon);
    label->setFixedSize(label->sizeHint());
    label->setPaletteBackgroundColor(colorGroup().mid());
    label->setAcceptDrops(true);

    label = new QLabel(heading, hbox);
    label->setAlignment(AlignLeft | AlignVCenter);
    label->setIndent(KDialog::spacingHint());
    label->setFont(boldFont);
    label->setPaletteForegroundColor(colorGroup().light());
    label->setPaletteBackgroundColor(colorGroup().mid());

    hbox->setPaletteBackgroundColor(colorGroup().mid());

    hbox->setMaximumHeight(hbox->minimumSizeHint().height());

    return hbox;
}
Пример #4
0
void MainWindow::createWidgets()
{
	QFrame* frame = new QFrame();
	frame->setStyleSheet(PSS("QWidget { background: kColour1; border-color: kColour2; }"));
	frame->setFrameStyle(QFrame::Box);

	QVBoxLayout *layout = new TightVBoxLayout;
	frame->setLayout(layout);

	layout->addWidget(new WindowHeader);

	QWidget* blackSep = new QWidget();
	blackSep->setFixedHeight(1);
	blackSep->setStyleSheet(PSS("QWidget { background: kColour2; }"));
	layout->addWidget(blackSep);

	layout->addSpacing(50);
	{
		QLabel* deviceImage = new QLabel();
		deviceImage->setFixedSize(600, 136);
		deviceImage->setStyleSheet(QString("QWidget { background-image: url(:/Device); }"));
		layout->addWidget(deviceImage, 0, Qt::AlignHCenter);
	}
	
	layout->addSpacing(50);

	m_controlsWidget = new ControlsWidget();
	layout->addWidget(m_controlsWidget, 0, Qt::AlignHCenter);

	layout->addStretch();

	setCentralWidget(frame);
}
Пример #5
0
void ViewerPageHandler::showEvent( QShowEvent* )
{
    qDebug() << Q_FUNC_INFO;
    if((m_visibleMask & EVPHM_PROGRESSBAR) && (m_visibleMask & EVPHM_CHAPTERLINE) && b_needToRepaint && m_currentPageIni != 0)
    {
        hideChapterLines();
        double realWidth = readingProgress->rect().width();
        //Create labels for each chapter and pos them into progressBar.
        for(int i = 0; i < linesPos.size(); i++)
        {
            QLabel* chapterLineLbl = new QLabel(readingProgressCont);
            chapterLineLbl->setFixedSize(m_chapterLineWidth,readingProgress->height());
            QImage myImage;
            myImage.load(":/res/chapter-progressbar.png");
            QImage image = myImage.scaled(chapterLineLbl->width(), chapterLineLbl->height(), Qt::IgnoreAspectRatio );
            chapterLineLbl->setPixmap(QPixmap::fromImage(image));
            int x = int((linesPos[i])*100/m_totalPages);
            double pos = double(x) * realWidth/100 - chapterLineLbl->width()/2;
            qDebug() << "Posicion" << pos;
            chapterLineLbl->move(pos,readingProgress->y());
            chapterLineLbl->show();
        }
        setNeedToPaint(false);
    }
}
QWidget* GeneratingView::createMainWidget()
{

    QLabel *label = new QLabel;
    label->setFixedSize(32,32);
    // FIXME: hidpi
    QString path = ":/resource/theme/images/spinner/32/";
    DMovie *movie = new DMovie(label);
    movie->setMoviePath(path, label);
    movie->start();

    DBaseButton *button = new DBaseButton(tr("Cancel"),this);
    button->setFixedSize(160, 36);
    connect(button, SIGNAL(clicked(bool)), this, SLOT(onCancelButtonClicked()));

    QWidget* mainWidget = new QWidget;

    InfoLabel* text = new InfoLabel;
    text->setText(tr("Generating verification code, please wait... "));

    auto mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);

    mainLayout->addSpacing(60);
    mainLayout->addWidget(label, 0, Qt::AlignHCenter);
    mainLayout->addSpacing(30);
    mainLayout->addWidget(text, 0, Qt::AlignHCenter);

    addButton(button);

    return mainWidget;
}
 /**
 * @brief GameBoard::game_over
 * Called if there are no hallows left. Tells the user that the game is over. Closes the game.
 */
void GameBoard::game_over()
{
    QLabel* endlabel = new QLabel("You lose! Game over!");
    endlabel->show();
    endlabel->setFixedSize(200,100);
    this->close();
}
Пример #8
0
SearchEdit::SearchEdit(QWidget *parent)
                    :QLineEdit(parent){
    QPixmap searchIcon(":search.png");
    QLabel* lbl = new QLabel(this);
    lbl->setScaledContents(true);
    lbl->setPixmap(searchIcon);
    lbl->setFixedSize(QSize(21,21));
    lbl->setStyleSheet("QLabel { border: none; padding: 0px; margin-left: 9px; margin-top: 8px;}");
    clearButton = new QToolButton(this);
    QPixmap pixmap(":clear_left.png");
      clearButton->setIcon(QIcon(pixmap));
      clearButton->setIconSize(QSize(18,18));
    clearButton->setCursor(Qt::ArrowCursor);
    clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; margin-right: 2px; margin-top: 3px;}");
    clearButton->hide();
      setAttribute(Qt::WA_MacShowFocusRect, false);
      connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
      connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&)));
      int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
      //setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(clearButton->sizeHint().width() + frameWidth + 1));
      QSize msz = minimumSizeHint();
      setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
                     qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
    
                    }        
Пример #9
0
PaletteTree::DraggableElement::DraggableElement(const Id &id, const QString &name
		, const QString &description, const QIcon &icon, bool iconsOnly, QWidget *parent)
	: QWidget(parent)
	, mId(id)
	, mIcon(icon)
	, mText(name)
{
	QHBoxLayout *layout = new QHBoxLayout(this);
	layout->setContentsMargins(4, 4, 4, 4);

	const int size = iconsOnly ? 50 : 30;
	QLabel *pic = new QLabel(this);
	pic->setFixedSize(size, size);  // the frame
	pic->setPixmap(mIcon.pixmap(size - 2, size - 2));
	layout->addWidget(pic);

	if (!iconsOnly) {
		QLabel *text = new QLabel(this);
		text->setText(mText);
		layout->addWidget(text);
	}

	setLayout(layout);

	QString modifiedDescription = description;
	if (!modifiedDescription.isEmpty()) {
		modifiedDescription.insert(0, "<body>");  //turns alignment on
		setToolTip(modifiedDescription);
	}
	setCursor(Qt::OpenHandCursor);
}
Пример #10
0
QLabel* RTIMULibDemo::getFixedPanel(QString text)
{
    QLabel *label = new QLabel(text);
    label->setFrameStyle(QFrame::Panel);
    label->setFixedSize(QSize(100, 16));
    return label;
}
Пример #11
0
RatingWidget::RatingWidget(Tellico::Data::FieldPtr field_, QWidget* parent_)
    : KHBox(parent_), m_field(field_), m_currIndex(-1) {
  m_pixOn = UserIcon(QLatin1String("star_on"));
  m_pixOff = UserIcon(QLatin1String("star_off"));
  setSpacing(0);

  // find maximum width and height
  int w = qMax(RATING_WIDGET_MAX_STAR_SIZE, qMax(m_pixOn.width(), m_pixOff.width()));
  int h = qMax(RATING_WIDGET_MAX_STAR_SIZE, qMax(m_pixOn.height(), m_pixOff.height()));
  for(int i = 0; i < RATING_WIDGET_MAX_ICONS; ++i) {
    QLabel* l = new QLabel(this);
    l->setFixedSize(w, h);
    m_widgets.append(l);
  }

  m_clearButton = new QToolButton(this);
  if(layoutDirection() == Qt::LeftToRight) {
    m_clearButton->setIcon(SmallIcon(QLatin1String("edit-clear-locationbar-rtl")));
  } else {
    m_clearButton->setIcon(SmallIcon(QLatin1String("edit-clear-locationbar-ltr")));
  }
  connect(m_clearButton, SIGNAL(clicked()), this, SLOT(clearClicked()));

  // to keep the widget from resizing when the clear button is shown/hidden
  // have a fixed width spacer to swap with
  const int mw = m_clearButton->minimumSizeHint().width();
  m_clearButton->setFixedWidth(mw);
  m_clearSpacer = new QSpacerItem(mw, mw, QSizePolicy::Fixed, QSizePolicy::Fixed);

  init();
}
Пример #12
0
void MainWindow::refreshScore()
{
    if(enemyKilled)
    {
        enemyKilled = false;
        int num = player->score;
        clearScore();

        do
        {
            int index = num%10;
            num /= 10;
            QPixmap temp(this->numbers[index]);
            QLabel* templbl = new QLabel();
            templbl->setPixmap(temp);
            templbl->setFixedSize(15,15);
            templbl->setScaledContents(true);
            templbl->setParent(this);
            scoreNumbers->append(templbl);

        }while(num != 0);

        int start = 30 + (30* scoreNumbers->size());
        for(int i = 0; i < scoreNumbers->size(); i++)
        {
            scoreNumbers->at(i)->move(start, 30);
            scoreNumbers->at(i)->show();
            start -=30;
        }
    }
}
Пример #13
0
void MainWindow::populateStore()
{

    int row = 0;
    int i = 0;
    for(auto item : store) {
        QString name(item.first.c_str());
        QString price(QString::number(item.second));
        QPushButton *button = new QPushButton(name);
        QLabel *label = new QLabel("$"+price);
        button->setObjectName(name);
        label->setObjectName(price);
        shopSignalMapper->setMapping(button, name);
        connect(button, SIGNAL(clicked()), shopSignalMapper, SLOT(map()));
        label->setAlignment(Qt::AlignCenter);
        ui->shopLayout->addWidget(button, row, i, Qt::AlignCenter);
        ui->shopLayout->addWidget(label, row+1, i, Qt::AlignCenter);
        QSize widgetSize(50, 50);
        button->setFixedSize(widgetSize);
        label->setFixedSize(widgetSize);
        i++;
        if(i == 9) {
            i = 0;
            row += 2;
        }
    }
}
Пример #14
0
PaletteToolbox::DraggableElement::DraggableElement(NewType const &type, QString const &name, QString const &description,
												   QIcon const &icon, QWidget *parent)
	: QWidget(parent), mType(type), mIcon(icon), mText(name)
{
	QHBoxLayout *layout = new QHBoxLayout(this);
	layout->setContentsMargins(4, 4, 4, 4);

	QLabel *pic = new QLabel(this);
	pic->setFixedSize(24, 24); // the frame
	pic->setPixmap(mIcon.pixmap(22, 22));
	layout->addWidget(pic);

	QLabel *text = new QLabel(this);
	text->setText(mText);
	layout->addWidget(text);

	setLayout(layout);

	QString modifiedDescription = description;
	if (!modifiedDescription.isEmpty()){
		modifiedDescription.insert(0, "<body>");//turns alignment on
		setToolTip(modifiedDescription);
	}

}
Пример #15
0
NBCategoryMenu::NBCategoryMenu( QString catName, QPixmap icon, QString wNode, QModelIndexList nodeList, QWidget *parent ) : QMenu( parent ) {

	mCategory = catName;
	mWorkNode = wNode;
	sNodes << nodeList;

	QWidgetAction *title = new QWidgetAction( this );
	QWidget *actBase = new QWidget( this );

	QLabel *pix = new QLabel();
	pix->setFixedSize( 20, 20 );
	pix->setPixmap( icon.scaled( 16, 16, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
	pix->setAlignment( Qt::AlignCenter );

	QLabel *name = new QLabel( "<b>" + catName + "</b>" );
	name->setFixedHeight( 20 );
	name->setAlignment( Qt::AlignVCenter );

	QHBoxLayout *lyt = new QHBoxLayout();
	lyt->setContentsMargins( QMargins( 4, 4, 4, 0 ) );
	lyt->addWidget( pix );
	lyt->addWidget( name );

	actBase->setLayout( lyt );
	title->setDefaultWidget( actBase );
	addAction( title );

	addSeparator();

	populateMenu();
};
Пример #16
0
QTitleWidget::QTitleWidget(QWidget *parent) :
    QWidget(parent)
{
    QHBoxLayout *hl = new QHBoxLayout;
    hl->setMargin(0);
    hl->setSpacing(0);
    setObjectName("titleWidget");
    QLabel * label = new QLabel;
    QImage image(":/inner/images/begin.png");
    label->setPixmap(QPixmap::fromImage(image));
    label->setFixedSize(16,16);
    QAction * ac = new QAction(QIcon(":/inner/images/delete_item.png"),tr("Remove Item"),this);
    m_delButton = new QToolBarButton(ac);
    ac = new QAction(QIcon(":/inner/images/add.png"),tr("Add Title"),this);
    m_addTitleButton = new QToolBarButton(ac);
    m_addTitleButton->setVisible(true);
    hl->addWidget(m_addTitleButton);
    hl->addWidget(label);
    hl->addSpacerItem(new QSpacerItem(1,1,QSizePolicy::Expanding,
                                      QSizePolicy::Expanding));
    hl->addWidget(m_delButton);
    setLayout(hl);

    setStyleSheet("#titleWidget{background-color:rgb(255,220,180);}");
    setFixedHeight(22);

    connect(m_addTitleButton,SIGNAL(clicked()),this,SIGNAL(addTitle()));
    connect(m_delButton,SIGNAL(clicked()),this,SIGNAL(delItem()));
}
void SwitchMonitor::initOneScreenMode(){
    // for one-screen mode
    for (int i = 0, length = m_ScreenList.length(); i < length; i++) {
        // one-screen mode item
        QWidget *item = new QWidget(m_MonitersWrapper);
        QVBoxLayout *vLayout = new QVBoxLayout(item);
        // image label for one-screen mode
        QSvgWidget *imageSvg = new QSvgWidget(item);
        imageSvg->setFixedSize(IMAGE_SIZE, IMAGE_SIZE);
        QLabel* imageLabel = new QLabel(item);
        imageLabel->setFixedSize(IMAGE_SIZE, IMAGE_SIZE);
        showThemeImage(getThemeIconPath("project_screen-onlyone-symbolic"), imageSvg, imageLabel);
        // text label for one-screen mode
        QLabel *textLabel = new QLabel(item);
        textLabel->setText(m_ScreenList[i]);
        textLabel->setAlignment(Qt::AlignCenter);
        textLabel->setStyleSheet(MONITOR_TEXT_NORMAL_STYLE);
        // store imagelabel and textlabel into lists, so that we can change their style later
        m_ImageSvgList << imageSvg;
        m_ImageLabelList << imageLabel;
        m_TextLabelList << textLabel;
        // add above 2 widgets
        if(getThemeIconPath("project_screen-onlyone-symbolic").endsWith(".svg")){
            vLayout->addWidget(imageSvg, 0, Qt::AlignHCenter);
        }else{
            vLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
        }
        vLayout->addWidget(textLabel, 0, Qt::AlignHCenter);

        m_HBoxLayout->addWidget(item);
    }
}
Пример #18
0
LoopItemView::LoopItemView( const AddToModelEnum & addToModelEnum,
                            const QString & detailedText,
                            const QPixmap & pixmap,
                            QWidget * parent ) 
  : QWidget( parent ),
    m_addToModelEnum( addToModelEnum ),
    m_detailedText( detailedText ),
    m_pixmap( pixmap )
{
  QVBoxLayout * mainVLayout = new QVBoxLayout();

  setLayout(mainVLayout);

  QLabel * label = new QLabel(detailedText);
  mainVLayout->addWidget(label,0,Qt::AlignLeft);

  QLabel * imageLabel = new QLabel();
  imageLabel->setFixedSize(m_pixmap.size());
  imageLabel->setPixmap(m_pixmap);
  mainVLayout->addWidget(imageLabel,0,Qt::AlignCenter);

  QPushButton * button = new QPushButton();
  button->setText("Add to Model");
  button->setObjectName("StandardGrayButton");
  mainVLayout->addWidget(button,0,Qt::AlignRight);

  connect(button, &QPushButton::clicked, this, &LoopItemView::emitAddToModelClicked);
}
void  boxAvail::drawitems ()
{
    int x=190, y=30;
    QLabel *starter;
    itemLinker *starterLinker;

    starter = new QLabel(QString::number (source.first ()->getId ()),this);
    starterLinker = new itemLinker(0,&Server, this);

    starter->setFixedSize (30,30);
    starter->setAlignment (Qt::AlignCenter);
    starter->setFrameShape (QFrame::WinPanel);

    starter->move (20,30);
    starterLinker->draw(50,30);

    for(it=source.begin (); it!=source.end (); ++it){
        (*it)->draw(x,y);
        (*it)->show();
        x+=140;
        if ( this->width()-x < 150){
            x=20, y+=50;
        }
    }
}
Пример #20
0
//Slot for the game help button
void Board::help()
{
    QLabel *instructions = new QLabel("                                    Game rules and instructions:\n                      Point the mouse curser in the direction you wish to shoot the bubble\n                      If the bubble forms a group with 3 or more same colour bubbles,\n                      they will be deleted and you will recieve points.");
    instructions->setWindowTitle("Bubble Shooter - Help");      //writes instruction and displayes them
    instructions->setFixedSize(400,200);
    instructions->show();
    qDebug("clicked Help");
}
Пример #21
0
void K3PasswordDialog::addLine(const QString &key, const QString &value)
{
    if (m_Row > 3)
	return;

    QLabel *lbl = new QLabel(key, m_pMain);
    lbl->setAlignment(Qt::AlignLeft|Qt::AlignTop);
    lbl->setFixedSize(lbl->sizeHint());
    m_pGrid->addWidget(lbl, m_Row+2, 0, Qt::AlignLeft);

    lbl = new QLabel(value, m_pMain);
    lbl->setAlignment(Qt::AlignTop);
    lbl->setWordWrap(true);
    lbl->setFixedSize(275, lbl->heightForWidth(275));
    m_pGrid->addWidget(lbl, m_Row+2, 2, Qt::AlignLeft);
    ++m_Row;
}
Пример #22
0
/*! Add a pair [label,widget] to main part of dialog, label is created from
		\b QString \b nameLabel.
\n	Recall \b addWidgets(QWdiget* firstW, QWdiget* secondW).
*/
void Dialog::addWidget(QString labelName, QWidget *widget)
{
	QLabel *label = new QLabel(labelName);
	m_labelList.push_back(label);
	label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
	label->setFixedSize(m_labelWidth, widget->height());
	addWidgets(label, widget);
}
Пример #23
0
QLabel *TypeIconLabel::getIcon(QString icon)
{
    QLabel *iconLabel = new QLabel(this);
    iconLabel->setFixedSize(16, 16);
    QPixmap pixmap = KIcon(icon).pixmap(16);
    iconLabel->setPixmap(pixmap);
    return iconLabel;
}
Пример #24
0
KBBTutorial::KBBTutorial(QWidget* parent) : QGroupBox(i18n("Tutorial"), parent)
{
	m_marker = 0;
	m_gameWidget = 0;

	setMinimumSize(QSize(WIDTH, WIDTH));
	setFixedWidth(WIDTH);

	QVBoxLayout *tutorialLayout = new QVBoxLayout();
	setLayout(tutorialLayout);
	setFlat(true);

	m_progression = new QProgressBar(this);
	m_progression->setTextVisible(true);
	m_progression->setFormat("%v / %m");
	m_progression->setMinimum(FIRST_STEP-1);
	m_progression->setMaximum(LAST_STEP);
	m_progression->setWhatsThis(i18n("Displays the progress of the tutorial."));
	tutorialLayout->addWidget(m_progression);

	m_title = new QLabel(this);
	tutorialLayout->addWidget(m_title, 0, Qt::AlignHCenter);

	m_explanation = new KTextEdit(this);
	m_explanation->setReadOnly(true);
	m_explanation->setFrameStyle(QFrame::NoFrame);
	m_explanation->setAlignment(Qt::AlignJustify);
	tutorialLayout->addWidget(m_explanation);

	tutorialLayout->addStretch();


	QHBoxLayout *actionLayout = new QHBoxLayout();
	tutorialLayout->addLayout(actionLayout);
	QLabel* iconLabel = new QLabel(this);
	iconLabel->setFixedSize(24, 24);
	iconLabel->setPixmap(KIcon( QLatin1String( "go-next" )).pixmap(24, 24));
	actionLayout->addWidget(iconLabel, 0, Qt::AlignVCenter);
	m_playerAction = new QLabel(this);
	m_playerAction->setWhatsThis(i18n("Describes what you should do to reach the next tutorial step."));
	m_playerAction->setAlignment(Qt::AlignLeft);
	m_playerAction->setWordWrap(true);
	m_playerAction->setFrameStyle(QFrame::StyledPanel);
	m_playerAction->setStyleSheet("border-style: none");
	actionLayout->addWidget(m_playerAction, 0, Qt::AlignVCenter);

	QHBoxLayout *buttonLayout = new QHBoxLayout();
	tutorialLayout->addLayout(buttonLayout);
	m_buttonPrevious = new KPushButton(KIcon( QLatin1String( "go-previous") ), i18nc("Previous tutorial step", "&Previous"), this);
	m_buttonPrevious->setWhatsThis(i18n("Go back to the previous tutorial step."));
	connect(m_buttonPrevious, SIGNAL(clicked()), this, SLOT(previousStep()));
	buttonLayout->addWidget(m_buttonPrevious);
	m_buttonNext = new KPushButton(KIcon( QLatin1String( "go-next")) , i18nc("Next tutorial step", "&Next"), this);
	m_buttonNext->setWhatsThis(i18n("Go to the next tutorial step."));
	connect(m_buttonNext, SIGNAL(clicked()), this, SLOT(nextStep()));
	m_buttonNext->setDefault(true);
	buttonLayout->addWidget(m_buttonNext);
}
Пример #25
0
AboutDialog::AboutDialog()
{
    this->setWindowTitle(tr("About"));

    QGridLayout *layout = new QGridLayout;
    this->setLayout(layout);

    QLabel *icon = new QLabel(this);
    icon->setPixmap(QIcon(":/img/icon.svg").pixmap(QSize(128, 128)));
    icon->setFixedSize(128, 128);
    icon->setScaledContents(true);
    layout->addWidget(icon, 0, 0, 2, 1, Qt::AlignTop);

    QLabel *text = new QLabel(this);
    text->setText(QString("<b>Edah %1</b><br/>").arg(utils->getAppVersion()) +
                  "<br/>" +
                  tr("Edah (heb. ʽe&middot;dhahʹ, eng. assembly) - program that handles multimedia during meetings. "
                       "Edah can be extended by plugins (for example: \"Player\", \"Recorder\", \"Stream\"), "
                       "supports touchscreen and is fully configurable.<br/>") +
                  "WWW: <a href=\"http://edah.tk\">edah.tk</a>");
    text->setOpenExternalLinks(true);
    text->setWordWrap(true);
    layout->addWidget(text, 0, 1);

    QLabel *text2 = new QLabel(this);
    text2->setText("<br/>"
                   "This software contains:<br/>"
                   "&#8226; <a href=\"http://www.typicons.com/\">Typicons</a> by Stephen Hutchings licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\">CC BY-SA</a><br/>"
                   "&#8226; <a href=\"https://www.openssl.org/\">OpenSSL</a> by The OpenSSL Project licensed under <a href=\"https://raw.githubusercontent.com/openssl/openssl/master/LICENSE\">OpenSSL License</a><br/>"
                   "&#8226; <a href=\"https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication\">QtSingleApplication</a> by Digia Plc and/or its subsidiary(-ies) licensed under BSD license<br/>"
                   "&#8226; <a href=\"http://www.google.com/fonts/specimen/Open+Sans\">Open Sans</a> by Steve Matteson licensed under <a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License 2.0</a><br/>"
                   "<br/>");
    text2->setOpenExternalLinks(true);
    text2->setWordWrap(false);
    layout->addWidget(text2, 1, 1);

    QLabel *text3 = new QLabel(this);
    text3->setText("This application uploads to update server data such as unique device ID, "
                   "version of your operating system and IP address.<br/><br/>"
                   "Copyright (C) 2016-2017 Łukasz Matczak &lt;<a href=\"mailto:[email protected]\">[email protected]</a>&gt;<br/>"
                   "This program comes with ABSOLUTELY NO WARRANTY. This is "
                   "free software, and you are welcome to redistribute it under "
                   "certain conditions; ");
#ifdef Q_OS_WIN
    text3->setText(text3->text() +
                   "<a href=\"LICENSE.txt\">click here</a> for details.");
#endif
    text3->setOpenExternalLinks(true);
    text3->setWordWrap(true);
    layout->addWidget(text3, 2, 1);

    QDialogButtonBox *btns = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeBtn = btns->button(QDialogButtonBox::Close);
    closeBtn->setText(tr("Close"));
    connect(closeBtn, &QPushButton::clicked, this, &AboutDialog::close);
    layout->addWidget(btns, 3, 0, 1, 2);
}
Пример #26
0
void TabBarWidget::tabInserted(int index)
{
	QTabBar::tabInserted(index);

	QLabel *label = new QLabel();
	label->setFixedSize(QSize(16, 16));

	setTabButton(index, m_iconButtonPosition, label);
	updateTabs();
}
Пример #27
0
void TabBarWidget::tabInserted(int index)
{
	QTabBar::tabInserted(index);

	QLabel *label = new QLabel();
	label->setFixedSize(QSize(16, 16));

	setTabButton(index, QTabBar::LeftSide, label);
	updateTabs();
}
Пример #28
0
QLabel * addLabel(QHBoxLayout * hboxLayout, QPixmap * pixmap) {
	QLabel * label = new QLabel();
	label->setObjectName("iconLabel");
	label->setAutoFillBackground(true);
	label->setPixmap(*pixmap);
	label->setFixedSize(pixmap->size());
	hboxLayout->addWidget(label);
	hboxLayout->addSpacing(IconSpace);

	return label;
}
Пример #29
0
QLabel* QPaintWidget::initAxisLabel(int x, int y, int labelWidth, int labelHeight, QFont font)
{
    QLabel *item = new QLabel(this);

    item->setAlignment(Qt::AlignCenter);
    item->setFont(font);
    item->setFixedSize(labelWidth,labelHeight);
    item->setGeometry(x,y,x+labelWidth,y+labelHeight);

    return item;
}
Пример #30
0
Change::Change(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Change)
{
    pathToRes = new QString("/home/midv/Projects/TrajectoryBuilder/Trajectory/resourses/");
    ui->setupUi(this);
    QHBoxLayout *generalLay = new QHBoxLayout(this);
    generalLay->setContentsMargins(0,0,0,0);
    QLabel *label = new QLabel();
    label->setFixedSize(this->size());
    label->setContentsMargins(0,0,0,0);
    label->setStyleSheet("QLabel{border:4px solid #00aa00; border-radius:10px}");
    generalLay->addWidget(label);
    QHBoxLayout *lay = new QHBoxLayout();
    label->setLayout(lay);
    lay->setAlignment(Qt::AlignCenter);
    lay->setSpacing(0);
    lay->setContentsMargins(5,0,0,0);
    QtSvgButton *button1 = new QtSvgButton();
    button1->setLockalSkin(*pathToRes,"Line");
    connect(button1,SIGNAL(clicked()),SLOT(pressButton1()));
    button1->setFixedSize(110,110);
    lay->addWidget(button1);
    QtSvgButton *button2 = new QtSvgButton();
    button2->setLockalSkin(*pathToRes,"Aссel");
    connect(button2,SIGNAL(clicked()),SLOT(pressButton2()));
    button2->setFixedSize(110,110);
    lay->addWidget(button2);
    QtSvgButton *button3 = new QtSvgButton();
    button3->setLockalSkin(*pathToRes,"ArcV");
    connect(button3,SIGNAL(clicked()),SLOT(pressButton3()));
    button3->setFixedSize(110,110);
    lay->addWidget(button3);
    QtSvgButton *button4 = new QtSvgButton();
    button4->setLockalSkin(*pathToRes,"ArcH");
    connect(button4,SIGNAL(clicked()),SLOT(pressButton4()));
    button4->setFixedSize(110,110);
    lay->addWidget(button4);
    QtSvgButton *button5 = new QtSvgButton();
    button5->setLockalSkin(*pathToRes,"ZmeyV");
    connect(button5,SIGNAL(clicked()),SLOT(pressButton5()));
    button5->setFixedSize(110,110);
    lay->addWidget(button5);
    QtSvgButton *button6 = new QtSvgButton();
    button6->setLockalSkin(*pathToRes,"ZmeyH");
    connect(button6,SIGNAL(clicked()),SLOT(pressButton6()));
    button6->setFixedSize(110,110);
    lay->addWidget(button6);
    QtSvgButton *button7 = new QtSvgButton();
    button7->setLockalSkin(*pathToRes,"Remove");
    connect(button7,SIGNAL(clicked()),SLOT(pressButton7()));
    button7->setFixedSize(110,110);
    lay->addWidget(button7);
}